package com.aio.news;

import java.util.List;

import org.apache.http.NameValuePair;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.aio.news.lib.SwipBackView;
import com.aio.news.net.HttpUtils.RequestState;

public class SwipeBackBaseFragment extends BaseFragment{

	protected SwipBackView mSwipBack;
	
	@Override
	public View initView(LayoutInflater inflater) {
		return null;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		mSwipBack = (SwipBackView)inflater.inflate(R.layout.swipback_fragment_layout, null);
		View view = initView(inflater);
		AioApplication.getInjector().injectView(view, this);
		mSwipBack.addView(view);
		mSwipBack.setContentView(view);
		mSwipBack.setOnClickListener(OnClickListener);
		mSwipBack.setSwipeListener(new SwipBackView.SwipeListener() {
			
			@Override
			public void onScrollStateChange(int state, float scrollPercent) {
			}
			
			@Override
			public void onScrollOverThreshold() {
			}
			
			@Override
			public void onEdgeTouch(int edgeFlag) {
			}
			
			@Override
			public void backAction() {
				back();
			}
		});
		afterCreated();
		return mSwipBack;
	}

	@Override
	public List<NameValuePair> getParams(RequestState state) {
		return null;
	}

	@Override
	public void RequestSuccess(String response, RequestState state) {
	}

	@Override
	public void RequestFail(String errString, RequestState state) {
	}

	@Override
	public void afterCreated() {
	}

}
